package com.hczx.caxa.bean;

import org.apache.commons.io.IOUtils;

import java.io.IOException;

public class HttpResponseBean {
    byte[] body;
    int statusCode;

    public HttpResponseBean() {
    }

    public HttpResponseBean(byte[] body, int statusCode) {
        this.body = body;
        this.statusCode = statusCode;
    }

    public byte[] getBody() {
        return body;
    }

    public void setBody(byte[] body) {
        this.body = body;
    }

    public int getStatusCode() {
        return statusCode;
    }

    public void setStatusCode(int statusCode) {
        this.statusCode = statusCode;
    }

    @Override
    public String toString() {
        String toString = "";
        try {
            toString = "HttpResponseBean{" +
                    "body=" + IOUtils.toString(body, "UTF-8") +
                    ", statusCode=" + statusCode +
                    '}';
        } catch (IOException e) {
            e.printStackTrace();
        }

        return toString;
    }
}
